<template>
	<view class="tn-safe-area-inset-bottom">
    <tn-nav-bar  fixed customBack :bottomShadow="false" backgroundColor="#FFFFFF">
      <view slot="back" class='tn-custom-nav-bar__back'
        @click="goBack">
        <text class='icon tn-icon-left'></text>
        <text class='icon tn-icon-home-capsule-fill'></text>
      </view>
			<view class="tn-flex tn-flex-col-center tn-flex-row-center ">
				<text class="tn-text-bold tn-text-xl tn-color-black">壁纸分类</text>
			</view>
    </tn-nav-bar>

		<view class="" :style="{paddingTop: vuex_custom_bar_height + 10 + 'px'}">
			<view class='nav-list'>
				<block v-for="(item, index) in navList" :key="index">
					<navigator @click="navSearch(item)" :style="{backgroundImage:'url('+item.cover+')'}" hover-class='none'
						class="nav-list-item tn-shadow-blur tn-cool-bg-image">
						<view class="nav-link">
							<view class='title'>{{ item.title }}</view>
							<!-- <view class='author'> <text class="tn-icon-code tn-padding-right-xs"></text> {{ content_item.author }}
							</view> -->
						</view>
					</navigator>
				</block>
			</view>
		</view>
	</view>
</template>

<script>
	import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
	import {
		seriesList
	} from "@/utils/api/image.js"
	export default {
		name: 'TemplateNavigation',
		mixins: [template_page_mixin],
		data() {
			return {
				navList: []
			}
		},
		onLoad() {
			this.getImageSeriesList()
		},
		methods: {
			getImageSeriesList() {
				seriesList().then(res => {
					console.log(res)
					this.navList = res.items
				})
			},
			navSearch(item) {
				uni.navigateTo({
					url: "/pageA/search/search?uid=" + item.uid
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	@import "@/scss/custom_nav_bar.scss";
	/* 胶囊*/
	.tn-custom-nav-bar__back {
	  width: 100%;
	  height: 100%;
	  position: relative;
	  display: flex;
	  justify-content: space-evenly;
	  align-items: center;
	  box-sizing: border-box;
	  background-color: rgba(0, 0, 0, 0.15);
	  border-radius: 1000rpx;
	  border: 1rpx solid rgba(255, 255, 255, 0.5);
	  color: #FFFFFF;
	  font-size: 18px;
	  
	  .icon {
	    display: block;
	    flex: 1;
	    margin: auto;
	    text-align: center;
	  }
	  
	  &:before {
	    content: " ";
	    width: 1rpx;
	    height: 110%;
	    position: absolute;
	    top: 22.5%;
	    left: 0;
	    right: 0;
	    margin: auto;
	    transform: scale(0.5);
	    transform-origin: 0 0;
	    pointer-events: none;
	    box-sizing: border-box;
	    opacity: 0.7;
	    background-color: #FFFFFF;
	  }
	}

	/* 组件导航列表 start*/
	.nav-list {
		display: flex;
		flex-wrap: wrap;
		padding: 0rpx 12rpx 0rpx;
		justify-content: space-between;

		/* 列表元素 start */
		.nav-list-item {
			padding: 0rpx 10rpx 15rpx 10rpx;
			border-radius: 12rpx;
			width: 45%;
			height: 160rpx;
			margin: 0 18rpx 30rpx;
			background-size: cover;
			background-position: center;
			position: relative;
			z-index: 99;

			/* 元素标题 start */
			.nav-link {
				font-size: 32rpx;
				text-transform: capitalize;
				padding: 0 0 10rpx 0;
				position: relative;

				.title {
					font-weight: bold;
					font-size: 36rpx;
					color: #FFFFFF;
					text-align: center;
					line-height: 160rpx;
				}

				.author {
					font-size: 25rpx;
					color: #FFFFFF;
					margin-top: 10rpx;
					margin-left: -10rpx;
					text-align: center;
				}
			}

			/* 元素标题 end */

			/* 元素图标 start */
			.icon {
				font-variant: small-caps;
				position: absolute;
				top: 20rpx;
				right: 50rpx;
				left: 37%;
				width: 90rpx;
				height: 90rpx;
				line-height: 90rpx;
				margin: 0;
				padding: 0;
				display: inline-flex;
				text-align: center;
				justify-content: center;
				vertical-align: middle;
				font-size: 50rpx;
				color: #FFFFFF;
				white-space: nowrap;
				opacity: 0.9;
				background-color: rgba(0, 0, 0, 0.05);
				background-size: cover;
				background-position: 50%;
				border-radius: 5000rpx;
			}

			/* 元素图标 end */
		}

		/* 列表元素 end */
	}

	/* 组件导航列表 end*/
</style>